<?php

/**
 * GameWeapon filter form base class.
 *
 * @package    aiontoolskit
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseGameWeaponFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'weapon_type'          => new sfWidgetFormChoice(array('choices' => array('' => '', '1h_dagger' => '1h_dagger', '1h_mace' => '1h_mace', '1h_sword' => '1h_sword', '1h_toolhoe' => '1h_toolhoe', '2h_book' => '2h_book', '2h_orb' => '2h_orb', '2h_polearm' => '2h_polearm', '2h_staff' => '2h_staff', '2h_sword' => '2h_sword', '2h_toolpick' => '2h_toolpick', '2h_toolrod' => '2h_toolrod', 'bow' => 'bow'))),
      'item_type'            => new sfWidgetFormChoice(array('choices' => array('' => '', 'abyss' => 'abyss', 'devanion' => 'devanion', 'draconic' => 'draconic', 'normal' => 'normal'))),
      'dmg_decal'            => new sfWidgetFormFilterInput(),
      'icon_name'            => new sfWidgetFormFilterInput(),
      'equipment_slots'      => new sfWidgetFormChoice(array('choices' => array('' => '', 'main' => 'main', 'main_or_sub' => 'main_or_sub'))),
      'min_damage'           => new sfWidgetFormFilterInput(),
      'max_damage'           => new sfWidgetFormFilterInput(),
      'str'                  => new sfWidgetFormFilterInput(),
      'agi'                  => new sfWidgetFormFilterInput(),
      'kno'                  => new sfWidgetFormFilterInput(),
      'hit_accuracy'         => new sfWidgetFormFilterInput(),
      'critical'             => new sfWidgetFormFilterInput(),
      'parry'                => new sfWidgetFormFilterInput(),
      'magical_skill_boost'  => new sfWidgetFormFilterInput(),
      'magical_hit_accuracy' => new sfWidgetFormFilterInput(),
      'attack_type'          => new sfWidgetFormChoice(array('choices' => array('' => '', 'magical_fire' => 'magical_fire', 'magical_water' => 'magical_water', 'physical' => 'physical'))),
      'attack_delay'         => new sfWidgetFormFilterInput(),
      'hit_count'            => new sfWidgetFormFilterInput(),
      'attack_range'         => new sfWidgetFormFilterInput(),
      'quality_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameItemQuality'), 'add_empty' => true)),
      'level'                => new sfWidgetFormFilterInput(),
      'option_slot_bonus'    => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'no_enchant'           => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'bonus_attr1'          => new sfWidgetFormFilterInput(),
      'bonus_attr2'          => new sfWidgetFormFilterInput(),
      'bonus_attr3'          => new sfWidgetFormFilterInput(),
      'bonus_attr4'          => new sfWidgetFormFilterInput(),
      'bonus_attr5'          => new sfWidgetFormFilterInput(),
      'bonus_attr6'          => new sfWidgetFormFilterInput(),
      'bonus_attr7'          => new sfWidgetFormFilterInput(),
      'bonus_attr8'          => new sfWidgetFormFilterInput(),
      'bonus_attr9'          => new sfWidgetFormFilterInput(),
      'bonus_attr10'         => new sfWidgetFormFilterInput(),
      'bonus_attr11'         => new sfWidgetFormFilterInput(),
      'bonus_attr12'         => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'weapon_type'          => new sfValidatorChoice(array('required' => false, 'choices' => array('1h_dagger' => '1h_dagger', '1h_mace' => '1h_mace', '1h_sword' => '1h_sword', '1h_toolhoe' => '1h_toolhoe', '2h_book' => '2h_book', '2h_orb' => '2h_orb', '2h_polearm' => '2h_polearm', '2h_staff' => '2h_staff', '2h_sword' => '2h_sword', '2h_toolpick' => '2h_toolpick', '2h_toolrod' => '2h_toolrod', 'bow' => 'bow'))),
      'item_type'            => new sfValidatorChoice(array('required' => false, 'choices' => array('abyss' => 'abyss', 'devanion' => 'devanion', 'draconic' => 'draconic', 'normal' => 'normal'))),
      'dmg_decal'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'icon_name'            => new sfValidatorPass(array('required' => false)),
      'equipment_slots'      => new sfValidatorChoice(array('required' => false, 'choices' => array('main' => 'main', 'main_or_sub' => 'main_or_sub'))),
      'min_damage'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'max_damage'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'str'                  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'agi'                  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'kno'                  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'hit_accuracy'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'critical'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'parry'                => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'magical_skill_boost'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'magical_hit_accuracy' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'attack_type'          => new sfValidatorChoice(array('required' => false, 'choices' => array('magical_fire' => 'magical_fire', 'magical_water' => 'magical_water', 'physical' => 'physical'))),
      'attack_delay'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'hit_count'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'attack_range'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'quality_id'           => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('GameItemQuality'), 'column' => 'id')),
      'level'                => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'option_slot_bonus'    => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'no_enchant'           => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'bonus_attr1'          => new sfValidatorPass(array('required' => false)),
      'bonus_attr2'          => new sfValidatorPass(array('required' => false)),
      'bonus_attr3'          => new sfValidatorPass(array('required' => false)),
      'bonus_attr4'          => new sfValidatorPass(array('required' => false)),
      'bonus_attr5'          => new sfValidatorPass(array('required' => false)),
      'bonus_attr6'          => new sfValidatorPass(array('required' => false)),
      'bonus_attr7'          => new sfValidatorPass(array('required' => false)),
      'bonus_attr8'          => new sfValidatorPass(array('required' => false)),
      'bonus_attr9'          => new sfValidatorPass(array('required' => false)),
      'bonus_attr10'         => new sfValidatorPass(array('required' => false)),
      'bonus_attr11'         => new sfValidatorPass(array('required' => false)),
      'bonus_attr12'         => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('game_weapon_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'GameWeapon';
  }

  public function getFields()
  {
    return array(
      'id'                   => 'Number',
      'weapon_type'          => 'Enum',
      'item_type'            => 'Enum',
      'dmg_decal'            => 'Number',
      'icon_name'            => 'Text',
      'equipment_slots'      => 'Enum',
      'min_damage'           => 'Number',
      'max_damage'           => 'Number',
      'str'                  => 'Number',
      'agi'                  => 'Number',
      'kno'                  => 'Number',
      'hit_accuracy'         => 'Number',
      'critical'             => 'Number',
      'parry'                => 'Number',
      'magical_skill_boost'  => 'Number',
      'magical_hit_accuracy' => 'Number',
      'attack_type'          => 'Enum',
      'attack_delay'         => 'Number',
      'hit_count'            => 'Number',
      'attack_range'         => 'Number',
      'quality_id'           => 'ForeignKey',
      'level'                => 'Number',
      'option_slot_bonus'    => 'Boolean',
      'no_enchant'           => 'Boolean',
      'bonus_attr1'          => 'Text',
      'bonus_attr2'          => 'Text',
      'bonus_attr3'          => 'Text',
      'bonus_attr4'          => 'Text',
      'bonus_attr5'          => 'Text',
      'bonus_attr6'          => 'Text',
      'bonus_attr7'          => 'Text',
      'bonus_attr8'          => 'Text',
      'bonus_attr9'          => 'Text',
      'bonus_attr10'         => 'Text',
      'bonus_attr11'         => 'Text',
      'bonus_attr12'         => 'Text',
    );
  }
}
